﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ChurchDiary.BLL;
using ChurchDiary.TableEntity;
using ChurchWebsite.Controllers;

namespace ChurchWebsite.Areas.Website.Controllers
{
    public class ArticleController : BaseController
    {
        //
        // GET: /Website/Article/
        public ActionResult Index()
        {
            return View();
        }
        public JsonResult AddArticle(EntityArticle Article)
        {
            return Json(new BLL_Website().InsertArticle(Article),JsonRequestBehavior.AllowGet);
        }
        public JsonResult UpdateArticle(EntityArticle Article)
        {
            return Json(new BLL_Website().UpdateArticle(Article), JsonRequestBehavior.AllowGet);
        }
        public JsonResult DeleteArticle(Guid dataId)
        {
            return Json(new BLL_Website().DeleteArticle(dataId), JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetArticles()
        {
            return Json(new BLL_Website().GetArticle(), JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetArticle(Guid dataId)
        {
            return Json(new BLL_Website().GetArticle(dataId), JsonRequestBehavior.AllowGet);
        }
    }
}
